//引入封装好的接口
import {
  bannerList
} from "../../../request/api";
const state = {
  bannerlist: [],
};

const getters = {
  getBannerList(state) {
      return state.bannerlist;
  },
};

const mutations = {
  REQ_BANNERLIST(state, payload) {
      state.bannerlist = payload
  }
};

const actions = {
  async changeBannerAction({
      commit
  }) {
      let res = await bannerList();
      // console.log(res, "菜单列表");
      commit('REQ_BANNERLIST', res.list)
  },
};

export default {
  state,
  getters,
  mutations,
  actions,
  //命名空间
  namespaced: true,
};